package com.bikes.mileagetracker.orm

import android.database.sqlite.SQLiteDatabase


/**
 * The interface which defined how to create a database.
 * @author Dose &middot; King &lt;doss.king@outlook.com&gt;
 */
interface DbCreator {
    /**
     * Obtain the database's name.
     * @return database name.
     */
    fun getDataBaseName(): String

    /**
     * Obtain the database's version.
     */
    fun getDataBaseVersion(): Int

    /**
     * Callback function when database not exists.
     */
    fun onCreate(db: SQLiteDatabase) {}

    /**
     * Callback function when database exists and it's version is lower than current version.
     */
    fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {}
}